home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-06-01 | 1.1 KB | 41 lines | [TEXT/GEOL] |
- Item forwarded by TIM.SWIHART to GARDNER.P CPLUS.BUGS
-
- Item 1594913 31-May-90 19:35PDT
-
- From: D6418 Jeppson, John,PRT
-
- To: CPLUS.DEV$ C++ Interest List--Developers
- MACDTS Macintosh Developer Tech Supt
-
- Sub: C++ string initialization
-
- Is this a bug in the C++ compiler?
-
- If it's a feature then what am I supposed to use? How, for example,
- can I initialize a Str255 if I can't do: Str255 s = "\pHumbug";
-
- ***********
-
- MPW C successfully compiles the following code, which then runs as expected.
-
- MPW C++ chokes on the initialization of "myOtherString". The compiler returns
-
- ### Error 217 L-value required
-
- *************
-
- #include <StdIO.h>
-
- typedef char stringType[30];
-
- int main( int argc, char* argv[] ) // "C++"
- // int main( int argc, char *argv[], char *envp[] ) // "C"
- {
- char myString[30] = "Hello1";
- stringType myOtherString = "Hello2";
-
- printf( "%s\n%s\n", myString, myOtherString );
- return 0;
- }
-
-